<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../../css/model.css">
    <link rel="stylesheet" href="../style/bxzc-1010/style.css">
    <title>冰洗专场</title>
</head>

<body>
    <div class="header"></div>
    <div class="body">
        <div class="banner"></div>
        <div class="title-1"></div>
        <div class="container clearfix">
        </div>
        <a href="http://www.cjwsc.com/lists/1039-040204-0.html" target="_blank" class="more">查看更多&gt;</a>
        <div class="title-2"></div>
        <div class="container clearfix">
        </div>
        <a href="http://www.cjwsc.com/lists/143-040206-0.html" target="_blank" class="more">查看更多&gt;</a>
        <div class="title-3"></div>
        <ul class="nav">
            <li class="cur fl">冰箱</li>
            <li class="fl">洗衣机</li>
        </ul>
        <div class="container clearfix">
        </div>
        <div class="back-top">返回顶部</div>
    </div>
    <div class="footer"></div>
    <!-- template -->
    <script type="text/html" id="card-tpl">
        <img src="{{pic}}" alt="">
        <p>{{name}}</p>
        <div>
            <span>活动价格:</span>&nbsp;&nbsp;
            <p>￥{{discountPrice}}</p>&nbsp;&nbsp;&nbsp;
            <del>原价：￥{{price_on_tag}}</del>
        </div>
        <span>立即抢购</span>
    </script>
    <script type="text/html" id="ctx-tpl">
        {{each $data}}
            <a class="card fl" target='_blank'></a>
        {{/each}}
    </script>
</body>
<script type="text/javascript" src="../../js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../../js/art-template.js"></script>
<script src="../../js/login.js"></script>
<script src="../../js/model.js"></script>
<script>
    // init start
    var WWW_URL = 'http://www.cjwsc.com';
    $(".header").topBox();
    $(".footer").footBox();
    // init end

    (function ($, template) {
        var info = [
            [112419,138980,142274],
            [120102,99522,116148]
        ]
        var info2 = [
            [117614,117616,115842,116772,133798,140338,139459,112419,142109,142741,116092,141831],
            [103400,103393,139059,112952,116148,109607,118547,128300,133923,116174,115724,139913],
        ]

        function getData(id, idx, index) {
            $.ajax({
                url: 'http://www.cjwsc.com/qcwdProduct/getProductByIds',
                data: {
                    ids: id,
                    business_type: 10,
                    client_type: 1
                },
                dataType: "jsonp",
                jsonp: 'jsonpcallback',
                success: function (res) {
                    var href = 'http://www.cjwsc.com/item/' + id + '.html';
                    res.msg[0].index = idx + 1;
                    res.msg[0].pic = res.msg[0].pic.replace('240_240', '800_800')
                    var element = index ? $('.container').eq(index).find('.card').eq(idx) : $('.card').eq(idx);
                    element.html(template('card-tpl', res.msg[0])).attr('href', href);
                    if (res.msg[0].stock_num == 0 || res.msg[0].status == 2) element.addClass('masker')
                        .removeAttr('href');
                }
            })
        }

        function setData(info){
            for(var i=0,len=info.length;i<len;i++){
                $('.container').eq(i).html(template('ctx-tpl',info[i]))
                for(var j=0,leng=info[i].length;j<leng;j++){
                    getData(info[i][j],j,i)
                }
            }
        }
        setData(info)

        function tabCard(info,index){
            $('.container').eq(index).html(template('ctx-tpl',info))            
            for(var i=0,len=info.length;i<len;i++){
                getData(info[i],i,index)                
            }
        }
        tabCard(info2[0],2)

        $('.nav').on('click','li',function(){
            var $this = $(this);
            $this.addClass('cur').siblings().removeClass('cur');
            tabCard(info2[$this.index()],2)
        })

        $('.back-top').on('click', function () {
            $('html,body').animate({
                scrollTop: 0
            }, 500)
        })
    }($, template))
</script>

</html>








